ββββββ βββββββ ββββββββββββ ββββββββββββ βββββββ ββββββββ
ββββββββββββββββ βββββββββββββ βββββββββββββββββββββββββββββ
βββββββββββ ββββββββββ ββββββ βββ βββ βββ βββββββββββ
βββββββββββ βββββββββ ββββββββββ βββ βββ βββββββββββ
βββ βββββββββββββββββββββββ ββββββ βββ βββββββββββββββββ
βββ βββ βββββββ βββββββββββ βββββ βββ βββββββ ββββββββ
Network Intelligence Platform β v2026.5.2
AI-powered MikroTik management via Telegram, WhatsApp & CLI
Docs Β· Quick Start Β· CLI Reference Β· Architecture Β· Contributing
Managing community WiFi infrastructure across multiple MikroTik nodes is painful. WinBox requires a desktop. RouterOS CLI requires memorizing commands. Hotspot billing requires manual voucher generation. Payment collection is disconnected from provisioning.
AgentOS collapses this into one intelligent agent you control from Telegram.
Before AgentOS: After AgentOS:
βββββββββββββββββ ββββββββββββββ
Open WinBox βββ Send "kick john"
Navigate menus β β β
Done in 2 seconds
Find user β
Right-click β Kick βββ
- Natural language router management via Gemini 2.5 Flash
- ReAct reasoning engine with 5-turn depth
- Context-aware command suggestions and error recovery
- AgentMemory for persistent session state
| Channel | Status | Notes |
|---|---|---|
| Telegram Bot | β Production | Inline keyboards, button menus |
| β Production | Baileys-powered, no Meta API needed | |
| WebSocket CLI | β Production | Browser terminal experience |
| REST API | β Production | Programmatic/webhook access |
| RouterOS Native | β Production | On-device Sentinel agent (.rsc) |
- Automated WiFi voucher generation (1Day/1GB Β· 7Day/7GB Β· 30Day/30GB)
- Mastercard Account-to-Account (A2A) payment integration via OAuth 1.0a RSA-SHA256
- QR code generation for voucher redemption
- Wallet-based voucher storage with Firebase sync
- Dual-limit expiry: time-based OR data quota (
limit-bytes-total), whichever comes first
- Multi-router mesh β manage multiple MikroTik nodes from one gateway
- Real-time DHCP/hotspot user monitoring
- Firewall rule management
- Ping, traceroute, bandwidth stats
- Automated alerts via Telegram on threshold breach
- CVE-2026-1526 patched
- Command allowlist (no arbitrary RCE via Telegram)
- HTTPS certificate validation on all outbound calls
- Tiered permission policy (admin / operator / readonly)
- Rate limiting + Joi input validation on all REST endpoints
- Audit trail for all router operations
- Node.js 20+ (ESM)
- MikroTik RouterOS 7.x
- Telegram Bot Token (from @BotFather)
- Google Gemini API Key
- Firebase project (or use local JSON fallback)
# Clone
git clone https://github.com/br3eze-code/br3eze-code.git
cd br3eze-code
# Install dependencies
npm install
# Interactive setup wizard
npm run onboard
# Or manual config
cp .env.example .env
nano .env# MikroTik
MIKROTIK_HOST=192.168.88.1
MIKROTIK_USER=admin
MIKROTIK_PASS=your_password
MIKROTIK_PORT=8728
# Telegram
TELEGRAM_TOKEN=your_bot_token
TELEGRAM_ADMIN_CHAT_ID=your_chat_id
# AI
GEMINI_API_KEY=your_gemini_key
# Payments (Mastercard A2A)
MC_CONSUMER_KEY=your_key
MC_PRIVATE_KEY_PATH=./certs/sandbox.p12
# Database
FIREBASE_PROJECT_ID=your_project
# Or leave blank for local JSON fallback# Foreground (development)
npm start
# Daemon mode (production)
agentos gateway --daemon
# Health check
agentos doctor
# RouterOS Sentinel (deploy to router)
# Upload agentos-sentinel.rsc to your MikroTik
# /import file-name=agentos-sentinel.rscagentos
βββ onboard Interactive setup wizard
βββ gateway WebSocket + Telegram gateway
β βββ --daemon Run as background service
β βββ --force Kill existing process first
β βββ gateway:stop Graceful shutdown
βββ status (s) System overview
βββ doctor [--fix] Health check + auto-repair
β
βββ network (net)
β βββ ping <host> ICMP ping via router
β βββ scan DHCP lease scan
β βββ firewall List firewall rules
β βββ block <ip|mac> Add drop rule
β βββ unblock <ip|mac> Remove drop rule
β
βββ users (user)
β βββ list [--all] Active / all hotspot users
β βββ kick <username> Disconnect user
β βββ add <username> Create hotspot user
β βββ remove <username> Delete user
β βββ status <username> Check online + usage
β
βββ voucher (v)
β βββ create [plan] Generate voucher (1Day|7Day|30Day)
β βββ list Recent vouchers
β βββ revoke <code> Delete unused voucher
β βββ stats Revenue + usage stats
β
βββ config
βββ get <path> Read config value
βββ set <path> <value> Write config value
βββ edit Open in $EDITOR
βββ show Display full config
/start Authenticate and show menu
/status Router status overview
/users Active user list with kick buttons
/kick Kick a user by name
/voucher Create voucher with plan selector
/stats Network + billing stats
/ping Ping a host
/firewall Show firewall rules
/help Full command list
ββββββββββββββββββββββββββββββββββββ
β Inbound Channels β
β Telegram β WhatsApp β REST β WS β
ββββββββββββββββββ¬ββββββββββββββββββ
β
ββββββββββββββββββΌββββββββββββββββββ
β AgentOS Core β
β ββββββββββββββββββββββββββββββββ β
β β AskEngine (ReAct Loop) β β
β β Gemini 2.5 Flash Β· 5T β β
β ββββββββββββββββ¬ββββββββββββββββ β
β βββββββββββββββΌββββββββββββββββ β
β β AgentMemory β NodeRegistry β β
β β SkillRegistry β HookRegistryβ β
β βββββββββββββββ¬ββββββββββββββββ β
ββββββββββββββββββΌββββββββββββββββββ
β
ββββββββββββββββββββββββΌβββββββββββββββββββββββ
β β β
ββββββββββββΌβββββββββββ βββββββββΌβββββββββ ββββββββββββΌβββββββββ
β MikroTik Manager β β Database β β Payment Gateway β
β routeros-client β β Firebase / β β Mastercard A2A β
β RouterOS API v7 β β Local JSON β β OAuth 1.0a RSA β
ββββββββββββ¬βββββββββββ βββββββββ¬βββββββββ βββββββββββββββββββββ
β β
ββββββββββββΌβββββββββββ βββββββββΌβββββββββ
β MikroTik Router β β Firestore β
β 192.168.88.1 β β Collections β
β + Sentinel .rsc β ββββββββββββββββββ
βββββββββββββββββββββββ
| Module | File | Role |
|---|---|---|
| Core Engine | agentos.mjs |
Entry point, boot sequence |
| Gateway | server/gateway.js |
WebSocket + HTTP server |
| MikroTik Manager | src/core/mikrotik.js |
RouterOS API adapter |
| AI Engine | agents/ask-engine.js |
Gemini ReAct loop |
| Billing | services/billing.js |
Voucher + payment flow |
| Sentinel | agentos-sentinel.rsc |
On-router native agent |
| CLI | bin/agentos.js |
Commander.js entry |
| Plan | Duration | Data Quota | Expires On |
|---|---|---|---|
| 1Day | 24 hours | 10 GB | Time OR quota (first) |
| 7Day | 7 days | 21 GB | Time OR quota (first) |
| 30Day | 30 days | 60 GB | Time OR quota (first) |
Payment flow: Mastercard A2A β Firebase β Voucher Generation β MikroTik Hotspot User
| Layer | Technology |
|---|---|
| Runtime | Node.js 20 ESM |
| Router API | MikroTik RouterOS Client v7 |
| AI Engine | Google Gemini 2.5 Flash |
| Messaging | node-telegram-bot-api + Baileys (WhatsApp) |
| Payments | Mastercard A2A Β· OAuth 1.0a RSA-SHA256 |
| Database | Firebase Firestore / Local JSON |
| Gateway | WebSocket (ws) + Express |
| CLI | Commander.js |
| Mobile | Apache Cordova (Android/iOS/PWA) |
| Security | Helmet Β· Rate-limit Β· Joi |
| Logging | Winston |
docker compose up -dcp agentos.podman.env .env
podman play kube agentos.yaml./install.sh
systemctl enable agentos
systemctl start agentos# Upload via WinBox Files or SCP, then:
/import file-name=agentos-sentinel.rsc
# Verify
/system/scheduler print
agentos/
βββ agentos.mjs Main entry (ESM)
βββ agentos-sentinel.rsc RouterOS native agent
βββ agentos-sentinel.rsc RouterOS bootstrap scripts
βββ bin/agentos.js CLI entry point
βββ src/
β βββ core/
β β βββ mikrotik.js RouterOS manager
β β βββ gateway.js WebSocket server
β β βββ database.js Firebase/local DB
β β βββ logger.js Winston logger
β βββ cli/
β βββ program.js Commander setup
β βββ commands/ CLI subcommands
βββ agents/ AI agent modules
βββ services/ Billing, voucher, payment
βββ adapters/ Channel adapters (TG, WA)
βββ skills/ Agent skill definitions
βββ workflows/ Automation workflows
βββ apps/shared/AgentOSkit/ Shared SDK
βββ custom-plugins/ Cordova plugin: aicore
βββ vscode-extension/ VS Code extension
βββ www/ Web UI (cyberpunk portal)
βββ docs/ Documentation
βββ tests/ Test suites
βββ scripts/ Deployment scripts
See CONTRIBUTING.md for full guidelines.
Quick ways to contribute:
- β Star the repo
- π Open an issue
- π‘ Start a discussion
- π§ Submit a PR tagged
good-first-issue
Apache 2.0 Β© 2026 Brighton Mzacana Β· br3eze.africa